﻿using Hook.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Win32;
using NHotkey.WindowsForms;
using NHotkey;

namespace zhiwuhook
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
            this.FormClosed += MainForm_FormClosed;
        }

        private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            HotkeyManager.Current.Remove("F2");
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            uint hwnd = KeyAndMouse.FindWindow(null, "new 2 - Notepad++");
            KeyAndMouse.SendKey(hwnd, 'A');
            //注册热键
            HotkeyManager.Current.AddOrReplace("F2", Keys.F1, false, MainForm_handler);
            return;
            Process p = Process.GetProcessesByName("San12").FirstOrDefault();
            if (p == null)
            {
                MessageBox.Show("绑定失败");
            }
            else
            {
                string lpbase = "0459C320";
                var b = Memory.ReadMomeryToInt(p.Id, lpbase);
                if (b > 0)
                {
                    Memory.WriteIntMomery(p.Id, lpbase, 5000);
                }
            }

        }

        private void MainForm_handler(object sender, HotkeyEventArgs e)
        {

        }


    }
}
